﻿<UserControl x:Class="Sautom.Modules.Client.Views.ContractEdit"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:res="clr-namespace:Sautom.I18N;assembly=Sautom.I18N" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <Style TargetType="Border">
            <Setter Property="BorderBrush" Value="Azure" />
            <Setter Property="BorderThickness" Value="3" />
        </Style>

        <Style TargetType="TextBlock">
            <Setter Property="Foreground" Value="Red" />
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200*" />
            <ColumnDefinition Width="200*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="250*" />
        </Grid.RowDefinitions>
        <Menu Grid.ColumnSpan="2">
            <MenuItem Header="{Binding Source={x:Static res:ClientResources.EditOrCreateBtn}}" Command="{Binding SaveCommand}" />
            <MenuItem Header="{Binding Source={x:Static res:ClientResources.BackToClientDetailsBtn}}" Command="{Binding BackCommand}" />
        </Menu>
        <StackPanel Grid.Row="1">
            <Border Margin="0,10,0,0">
                <StackPanel>
                    <Label Content="{Binding Source={x:Static res:ClientResources.ConsultingNumberLabel}}" />
                    <TextBox Text="{Binding ConsultingNumber}" />
                    <Label Content="{Binding Source={x:Static res:ClientResources.ConsultingDateLabel}}" />
                    <DatePicker SelectedDate="{Binding ConsultingDate, UpdateSourceTrigger=PropertyChanged}" DisplayDateEnd="{Binding ConsultingActDate}" />
                    <Label Content="{Binding Source={x:Static res:ClientResources.ConsultingHoursLabel}}" />
                    <TextBox Text="{Binding ConsultingHours, UpdateSourceTrigger=PropertyChanged}" />

                    <DockPanel Margin="0,5,5,5">
                        <Label Content="{Binding Source={x:Static res:ClientResources.RateValueLabel}}" Margin="0,0,5,0" />
                        <TextBlock Text="{Binding ConsultingRate.RateValue}" />
                    </DockPanel>

                    <Label Content="{Binding Source={x:Static res:ClientResources.ConsultingSumLabel}}" />
                    <TextBlock Text="{Binding ConsultingSum}" />
                    <Label Content="{Binding Source={x:Static res:ClientResources.ConsultingActDateLabel}}" />
                    <DatePicker SelectedDate="{Binding ConsultingActDate, UpdateSourceTrigger=PropertyChanged}" DisplayDateStart="{Binding ConsultingDate}" />
                </StackPanel>
            </Border>
            <Border Margin="0,10,0,0">
                <StackPanel>
                    <Label Content="{Binding Source={x:Static res:ClientResources.WorkshopNumberLabel}}" />
                    <TextBox Text="{Binding WorkshopNumber}" />
                    <Label Content="{Binding Source={x:Static res:ClientResources.WorkshopDateLabel}}" />
                    <DatePicker SelectedDate="{Binding WorkshopDate, UpdateSourceTrigger=PropertyChanged}" DisplayDateEnd="{Binding WorkshopActDate}" />
                    <Label Content="{Binding Source={x:Static res:ClientResources.WorkshopHoursLabel}}" />
                    <TextBox Text="{Binding WorkshopHours, UpdateSourceTrigger=PropertyChanged}" />

                    <DockPanel Margin="0,5,5,5">
                        <Label Content="{Binding Source={x:Static res:ClientResources.RateValueLabel}}" Margin="0,0,5,0" />
                        <TextBlock Text="{Binding ConsultingRate.RateValue}" />
                    </DockPanel>

                    <Label Content="{Binding Source={x:Static res:ClientResources.WorkshopSumLabel}}" />
                    <TextBlock Text="{Binding WorkshopSum}" />
                    <Label Content="{Binding Source={x:Static res:ClientResources.WorkshopActDateLabel}}" />
                    <DatePicker SelectedDate="{Binding WorkshopActDate, UpdateSourceTrigger=PropertyChanged}" DisplayDateStart="{Binding WorkshopDate}" />
                </StackPanel>
            </Border>
            <Border Margin="0,10,0,0">
                <StackPanel>
                    <Label Content="{Binding Source={x:Static res:ClientResources.InvoiceDateLabel}}" />
                    <DatePicker SelectedDate="{Binding InvoiceDate, UpdateSourceTrigger=PropertyChanged}" />
                    <Label Content="{Binding Source={x:Static res:ClientResources.InvoiceSumLabel}}" />
                    <TextBox Text="{Binding InvoiceSum, UpdateSourceTrigger=PropertyChanged}" />
                </StackPanel>
            </Border>
        </StackPanel>
    </Grid>
</UserControl>
